﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NodeBasedSkillEditor.Model.CommandHistory
{
    public class Cmd_CreateNode : CommandRecord
    {
        public override ECommandType CmdType => ECommandType.CreateNode;

        public string NodeDataJson;

        public Cmd_CreateNode(NodeData newCreatedNodeData)
        {
            NodeDataJson = SwifterJson.XFormatter.ToJson(newCreatedNodeData);
        }

        public NodeData GetNodeData()
        {
            NodeData data = SwifterJson.XFormatter.FromJson<NodeData>(NodeDataJson);
            return data;
        }
    }
}
